package com.jfreer.blog.web;

import com.jfreer.blog.service.ITestService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * User: landy
 * Date: 15/5/4
 * Time: 下午1:26
 */
@Controller
@RequestMapping
public class IndexController {
    @Resource
    private ITestService testService;

    @RequestMapping(value = {"index", "", "/"})
    public String index() {
        return "home";
    }

    @RequestMapping("all")
    @ResponseBody
    public Object all() {
        return testService.all();
    }

    @RequestMapping("first")
    @ResponseBody
    public Object first() {
        return testService.first();
    }

    @RequestMapping("hello")
    @ResponseBody
    public Object hello() {
        return testService.hello();
    }
    @RequestMapping("world")
    @ResponseBody
    public Object world() {
        return testService.world();
    }
    @RequestMapping("exception")
    @ResponseBody
    public Object exception() {
        return testService.exception();
    }
}
